package com.zhoujinlong.ui.adapter;

import android.content.Context;
import android.widget.ImageView;

import com.android.core.adapter.RecyclerAdapter;
import com.android.core.adapter.RecyclerViewHolder;
import com.zhoujinlong.R;
import com.zhoujinlong.model.bean.ExerciseBean;
import com.zhoujinlong.utils.BaseUtil;

import java.util.List;

/**
 * @author: 蜡笔小新
 * @date: 2016-05-31 14:15
 * @GitHub: https://github.com/meikoz
 */
public class PlanRecyclerAdapter extends RecyclerAdapter<ExerciseBean> {

    private Context mContext;

    public PlanRecyclerAdapter(Context context, int layoutId, List<ExerciseBean> datas) {
        super(context, layoutId, datas);
        this.mContext = context;
    }

    @Override
    public void convert(final RecyclerViewHolder holder, final ExerciseBean item) {
        ((ImageView) holder.getView(R.id.iv_trainer_guide)).setImageResource(BaseUtil.getDrawableId(mContext, "plan"+item.getType()));
        holder.setText(R.id.tv_trainer_title, item.getTitle());
    }
}
